using System;
using System.Collections.Generic;
using System.Text;
using SpriteCraft;

namespace SpaceGame
{
  public class Cursor : IOnUpdate
  {
    private EngineClass m_Engine;
    private ISprite m_DefaultCursor;

    public Cursor(EngineClass engine)
    {
      m_Engine = engine;

      m_DefaultCursor = m_Engine.NewSprite("DefaultCursor", "cursor_default", 5, m_Engine.mouseX, m_Engine.mouseY);
      m_DefaultCursor.subimpl = this;
      m_DefaultCursor.transparency = 0.5f;

      
    }
    #region IOnUpdate Members

    public void OnUpdate(ISprite sprite, int tickdelta)
    {
      if (m_Engine.mouseIn)
      {
        sprite.visible = true;
        sprite.x = m_Engine.mouseX;
        sprite.y = m_Engine.mouseY;
      }
      else
      {
        sprite.visible = false;
      }
    }

    #endregion
  }
}
